package com.lingchen.boot.jmm;


import org.openjdk.jcstress.annotations.*;
import org.openjdk.jcstress.infra.results.II_Result;

/**
 * Created by lc on 2020/7/15
 */
@JCStressTest
@State
@Outcome(id = "1,0", expect = Expect.ACCEPTABLE)
@Outcome(id = "0,2", expect = Expect.ACCEPTABLE)
@Outcome(id = "1,2", expect = Expect.ACCEPTABLE)
@Outcome(id = "0,0", expect = Expect.ACCEPTABLE_INTERESTING)
public class TestJmm {
    int a, b;

    @Actor
    public void act1(II_Result r) {
        a = 1;
        r.r2 = b;
    }

    @Actor
    public void act2(II_Result r) {
        b = 2;
        r.r1 = a;
    }



}
